(* Bring up the alert. When Alert calls GetResource it will
* find the info we just set in the alert's resource. Note
* that this info is only in memory; it won't be written
* to disk unless we called ChangeResource and then
* write it to disk using WriteResource. (You probably don't
* want to write the info to disk, since the whole point
* is to properly position the Alert on any display system.)
*)
CenteredAlert := Alert(alertId, filterProc)
end;
(Sorry in advance for any typos. I don't have a Mac handy
to test this code on.)
Cheers!
John
- ---
John Wallace buckeye@spf.trw.com
+++++++++++++++++++++++++++
From: mauser@intercon.com (Richard Chandler)
Date: 16 May 92 03:01:16 GMT
Organization: InterCon Systems Corporation
{Code example deleted}
If you know you're going to use this technique, you can save yourself a
little computation by putting the topleft of the alert at (0, 0), then the
bottom and right coordinates give you your width and height.
I think there was a human interface guidline that suggested not exactly
centering the alert, but theoretically having the top aligned with an
imaginary line 1/3 of the way down the screen. Aesthetically that's a bit
bette anyway.
- --
Praying for the day when "Sex Scandal" is an oxymoron.
"Ride a motorcycle. Save Gas, Oil, Rubber, Steel, Aluminum, Parking Spaces,
The Environment, and Money. Plus, you get to wear all the leather you want!"
Rich Chandler, DoD #296
+++++++++++++++++++++++++++
From: nilesinc@well.sf.ca.us (Avi Rappoport)
Date: 18 May 92 23:48:42 GMT
Organization: Whole Earth 'Lectronic Link
John Wallace buckeye@spf.trw.com
Did a good job with this, and his code should work. It's easy to
change it to 1/3 of the way down the screen.
2 problems:
1) How do you decide which is the "active" screen? It's either the
location of the majority of the active window, or the screen on which
the cursor is located -- I never got a chance to test this with users.
2) You have to cope with Radius etc. monitors, which change screenbits.
bounds and create a region rather than a rect. I have some code somewhere,
but again, never got to test it.
Anyone else?
- --
- -- Ask me about EndNote and EndNote Plus Bibliography Makers --
Avi Rappoport 2000 Hearst, Berkeley, CA 94709
nilesinc@well.sf.ca.us, 510-649-8176
Niles.Assoc on AppleLink fax: 510-649-8179
+++++++++++++++++++++++++++
From: buckeye@spf.trw.com (John Wallace)
Organization: TRW Data Systems Center, Redondo Beach, CA
Date: Tue, 19 May 92 22:07:07 GMT
In article <nilesinc.706232922@well.sf.ca.us> nilesinc@well.sf.ca.us (Avi Rappoport) writes:
>
>2) You have to cope with Radius etc. monitors, which change screenbits.
>bounds and create a region rather than a rect. I have some code somewhere,
>but again, never got to test it.
>
I haven't been able to test the code on Radius monitors, so I don't
know whether the original code will work on them for certain.
However, in the code, I get the main graphics device and then find
its bounds rect. (The main graphics device is the one with the
menubar on it.) I would guess that Radius sets up its GWorlds
properly, otherwise all sorts of things would fail on their
monitors. Does anyone know for certain??
Thanks
John
- ----
John Wallace buckeye@spf.trw.com
+++++++++++++++++++++++++++
From: nilesinc@well.sf.ca.us (Avi Rappoport)
Date: 20 May 92 22:16:52 GMT
Organization: Whole Earth 'Lectronic Link
In <2A197C0B.9B8@deneva.sdd.trw.com> buckeye@spf.trw.com (John Wallace) writes:
>I haven't been able to test the code on Radius monitors, so I don't
>know whether the original code will work on them for certain.
>However, in the code, I get the main graphics device and then find
>its bounds rect. (The main graphics device is the one with the
>menubar on it.) I would guess that Radius sets up its GWorlds
>properly, otherwise all sorts of things would fail on their
>monitors. Does anyone know for certain??
Nope. Radius doesn't use GWorlds at all, just screenbits.bounds. I think this is because non-color-capable (color-incapable?) Macs don't have GWorlds. And
things do fail.
Avi
(space added to fool fascist news program)
- --
- -- Ask me about EndNote and EndNote Plus Bibliography Makers --
Avi Rappoport 2000 Hearst, Berkeley, CA 94709
nilesinc@well.sf.ca.us, 510-649-8176
Niles.Assoc on AppleLink fax: 510-649-8179
---------------------------
From: jryan@adobe.com (Jim Ryan)
Subject: Fun with FindFolder
Date: 15 May 92 18:24:50 GMT
Organization: Adobe Systems Incorporated
OK, my prefs code is getting close. A BIG thanks to all who have given
me all the great feedback! I went the resource route, but now
FindFolder is giving me fits.
FindFolder returns the blessed System volume number and the
"directory ID," right? My code will currently save and retrieve
the Prefs file to the blessed System Folder under System 6, however
passing the FindFolder results to SetVol(theDirID, theSysVRefNum) puts my
prefs file in the same folder as my app when running 7.0.